﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ETA.IRepository;
using ETA.IService;
using ETA.Repositories;
using ETA.Service;
using Ninject;

namespace ETA.DI
{
    /// <summary>
    /// 依赖注册
    /// </summary>
    public class DI
    {
        public static void RegisterServices(IKernel kernel)
        {
            #region 服务接口注入

            kernel.Bind<IUserService>().To<UserService>();
            kernel.Bind<IBannerService>().To<BannerService>();
            kernel.Bind<IUploadFileService>().To<UploadFileService>();
            kernel.Bind<IFileTypeService>().To<FileTypeService>();
            kernel.Bind<IProjectTypeService>().To<ProjectTypeService>();
            kernel.Bind<IWorkTypeService>().To<WorkTypeService>();
            kernel.Bind<IRegistrationMainFormService>().To<RegistrationMainFormService>();
            kernel.Bind<IFlowStepService>().To<FlowStepService>();
            kernel.Bind<IFlowLogService>().To<FlowLogService>();
            kernel.Bind<IWebMessageService>().To<WebMessageService>();

            kernel.Bind<IRegistrationBasicInfoService>().To<RegistrationBasicInfoService>();
            kernel.Bind<IRegistrationEducationService>().To<RegistrationEducationService>();
            kernel.Bind<IRegistrationFamilayService>().To<RegistrationFamilayService>();
            kernel.Bind<IRegistrationJobService>().To<RegistrationJobService>();
            kernel.Bind<IDocumentService>().To<DocumentService>();
            kernel.Bind<IAskForHelpService>().To<AskForHelpService>();
            kernel.Bind<IJoinApplyFormService>().To<JoinApplyFormService>();
            kernel.Bind<IQuestionService>().To<QuestionService>();
            kernel.Bind<IReferrerLogService>().To<ReferrerLogService>();
            kernel.Bind<IWorkTypeInfoService>().To<WorkTypeInfoService>();
            kernel.Bind<IMBTIService>().To<MBTIService>();
            #endregion

            #region 数据仓储层接口注入

            kernel.Bind<IRolerRepository>().To<RolerRepository>();
            kernel.Bind<IUserRepository>().To<UserRepository>();
            kernel.Bind<IFeatureBannerRepository>().To<FeatureBannerRepository>();
            kernel.Bind<IUploadFileRepository>().To<UploadFileRepository>();
            kernel.Bind<IFileTypeRepository>().To<FileTypeRepository>();
            kernel.Bind<IProjectTypeRepository>().To<ProjectTypeRepository>();
            kernel.Bind<IWorkTypeRepository>().To<WorkTypeRepository>();
            kernel.Bind<IRegistrationMainFormRepository>().To<RegistrationMainFormRepository>();
            kernel.Bind<IFlowStepRepository>().To<FlowStepRepository>();
            kernel.Bind<IFlowLogRepository>().To<FlowLogRepository>();
            kernel.Bind<IWebMessageRepository>().To<WebMessageRepository>();

            kernel.Bind<IRegistrationBasicInfoRepository>().To<RegistrationBasicInfoRepository>();
            kernel.Bind<IRegistrationEducationRepository>().To<RegistrationEducationRepository>();
            kernel.Bind<IRegistrationFamilayRepository>().To<RegistrationFamilayRepository>();
            kernel.Bind<IRegistrationJobRepository>().To<RegistrationJobRepository>();
            kernel.Bind<IDocumentRepository>().To<DocumentRepository>();
            kernel.Bind<IAskForHelpRepository>().To<AskForHelpRepository>();
            kernel.Bind<IJoinApplyFormRepository>().To<JoinApplyFormRepository>();
            kernel.Bind<IQuestionRepository>().To<QuestionRepository>();
            kernel.Bind<IReferrerLogRepository>().To<ReferrerLogRepository>();
            kernel.Bind<IWorkTypeInfoRepository>().To<WorkTypeInfoRepository>();
            kernel.Bind<IMBTIRepository>().To<MBTIRepository>();
            #endregion
        }
    }
}
